<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				
			</div>
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="paychannel:tmFundChannelExt:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="paychannel:tmFundChannelExt:export">
						<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('paychannel:tmFundChannelExt:edit')}]];
        var removeFlag = [[${@permission.hasPermi('paychannel:tmFundChannelExt:remove')}]];
        var prefix = ctx + "paychannel/tmFundChannelExt";
        var attrTypeDatas = [[${@dict.getType('channel_attr_type')}]];
        var valueTypeDatas = [[${@dict.getType('channel_valuse_type')}]];
        var needMatchDatas = [[${@dict.getType('channel_ext_need_match')}]];
        var matchTypeDatas = [[${@dict.getType('channel_ext_match_type')}]];
        
        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "资金渠道特性",
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'extId', 
					title : '扩展ID',
					visible: false
				},
				{
					field : 'fundChannelCode', 
					title : '资金源编码',
					sortable: true
				},
				{
					field : 'attrKey', 
					title : '属性名',
					sortable: true
				},
				{
					field : 'attrValue', 
					title : '属性值',
					sortable: true
				},
				{
					field : 'attrType', 
					title : '属性类型',
					sortable: true,
				 	formatter: function(value, row, index) {
				      return $.table.selectDictLabel(attrTypeDatas, value);
				  	}
				},
				{
					field : 'valueType', 
					title : '值类型',
					sortable: true,
				 	formatter: function(value, row, index) {
					      return $.table.selectDictLabel(valueTypeDatas, value);
					  	}
				},
				{
					field : 'valueSplit', 
					title : '值分隔符',
					sortable: true
				},
				{
					field : 'attrCodeKey', 
					title : '属性字典标识',
					sortable: true
				},
				{
					field : 'apiCode', 
					title : 'api编码',
					sortable: true
				},
				{
					field : 'needMatch', 
					title : '是否需要满足VALUE指定',
					sortable: true,
				 	formatter: function(value, row, index) {
					      return $.table.selectDictLabel(needMatchDatas, value);
					  	}
				},
				{
					field : 'matchType', 
					title : '比较类型',
					sortable: true,
				 	formatter: function(value, row, index) {
					      return $.table.selectDictLabel(matchTypeDatas, value);
					  	}
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.extId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.extId + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>